package cn.iocoder.yudao.module.javainfo.controller.admin.tagcloud;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.javainfo.controller.admin.tagcloud.vo.TagCloudItemRespVO;
import cn.iocoder.yudao.module.javainfo.service.tagcloud.TagCloudService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 标签云")
@RestController
@RequestMapping("/javainfo/tag-cloud")
@Validated
public class TagCloudController {

    @Resource
    private TagCloudService tagCloudService;

    @GetMapping("/user-names")
    @Operation(summary = "获取用户姓名标签云数据")
    public CommonResult<List<TagCloudItemRespVO>> getUserNameTags() {
        return success(tagCloudService.getUserNameTags());
    }

    @GetMapping("/pet-names")
    @Operation(summary = "获取宠物姓名标签云数据")
    public CommonResult<List<TagCloudItemRespVO>> getPetNameTags() {
        return success(tagCloudService.getPetNameTags());
    }

    @GetMapping("/pet-photos")
    @Operation(summary = "获取宠物照片标签云数据")
    public CommonResult<List<TagCloudItemRespVO>> getPetPhotoTags() {
        return success(tagCloudService.getPetPhotoTags());
    }
}

